package cn.edu.nuc.film.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.nuc.film.dao.RemainMapper;
import cn.edu.nuc.film.entity.Remain;
import cn.edu.nuc.film.entity.Screens;
import cn.edu.nuc.film.service.interfaces.RemainService;

@Service
public class RemainServiceImpl implements RemainService {
	
	
	@Autowired
	private RemainMapper remainMapper;
	
	
	
	/**
	 * 获取remain的信息
	 */
	@Override
	public Remain remain(int gid) {
		Remain remain = remainMapper.remain(gid);
		return remain;
	}
	
	/**
	 * 获取指定影院、影厅、影片的remain表的信息
	 */
	public List<Remain> list( int fcId,int filmId){
		
		List<Remain> list = remainMapper.list(fcId,filmId);
		return list;
		
	}
	
	
	@Override
	public int addRemain(Screens screens,int filmId) {
		
		int count = remainMapper.insert(screens,filmId);
		
		return count;
	}

	@Override
	public int updateRemain(Remain remain) {
		
		remainMapper.updateByPrimaryKeySelective(remain);
		return 0;
	}

	@Override
	public int deleteRemain(int screensid, int filmId) {
		
		//int count = remainMapper.deleteByPrimaryKey(gid)
		return 0;
	}


	
	
	
	
}
